Skip to content

Add public_descriptor to wallet implementation#786

Merged
reez merged 1 commit intobitcoindevkit:masterfrom
ItoroD:expose-public-descriptor
Jun 19, 2025
Merged

Add public_descriptor to wallet implementation#786
reez merged 1 commit intobitcoindevkit:masterfrom
ItoroD:expose-public-descriptor

Conversation

@ItoroD
Copy link
Copy Markdown
Collaborator

@ItoroD ItoroD commented Jun 19, 2025

Description

I have been working with wallet and our descriptor type for my work on Psbt and multisig. I noticed that we cannot get the descriptor used to create the wallet directly from the Wallet type. Hence exposing public_descriptor will allow us get this directly. A good use case is if you want to create a watch only wallet you could just call public_descriptor.

At the moment I am returning the descriptor as a string instead of a ExtendedDescriptor. The downside to this is we loose all the functionality ExtendedDescriptor provides. We do not have a ExtendedDescriptor type which is just an alias for Descriptor<DescriptorPublicKey>.

We could create and implement the type if necessary instead of using a string.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@ItoroD ItoroD changed the title feat: expose public_descriptor in wallet impl Add public_descriptor in wallet impl Jun 19, 2025
@ItoroD ItoroD changed the title Add public_descriptor in wallet impl Add public_descriptor to wallet impl Jun 19, 2025
@ItoroD ItoroD changed the title Add public_descriptor to wallet impl Add public_descriptor to wallet implementation Jun 19, 2025
@ItoroD ItoroD requested a review from reez June 19, 2025 11:40
Copy link
Copy Markdown
Collaborator

@reez reez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fdcf68e

Thanks for adding this. Appreciate you adding the notes about extended descriptor, and I think the way you have it with string is the correct way for our codebase currently too.

@reez reez merged commit 81c0cff into bitcoindevkit:master Jun 19, 2025
20 checks passed
@thunderbiscuit
Copy link
Copy Markdown
Member

lol I can't believe we didn't have this API exposed before! Thanks Itoro.

@ItoroD ItoroD deleted the expose-public-descriptor branch June 19, 2025 15:44
@ItoroD
Copy link
Copy Markdown
Collaborator Author

ItoroD commented Jun 19, 2025

Thanks for the review! @reez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants